ESCB & SSM HACKATHON

Foundation Models for Macroeconomic Forecasting

Ilias Aarab

ECB/DG Economics

November 18, 2025

Econometric Models vs Foundation Models

Traditional Econometric Approach:

  1. Define your model (e.g., AR, VAR, DSGE)
  2. Estimate parameters on your specific dataset
  3. Forecast using the estimated model

Foundation Model Approach:

  1. Pre-train a large-capacity model on general data (not task-specific)
  2. Model learns general statistical structures across diverse time series
  3. Apply off-the-shelf to your specific forecasting task - no estimation needed.

Key Insight

Foundation models are already estimated. You skip the estimation step entirely.

Foundation Models: A Paradigm Shift

Econometric Models

  • Task-specific
  • Requires domain expertise
  • Limited by data availability
  • Need re-estimation for new data
  • Interpretable parameters

Foundation Models

  • General-purpose
  • Learn from massive datasets
  • Transfer learning across domains
  • Zero-shot forecasting
  • more “black-box” like

For Macroeconomic Forecasting

Foundation models can capture complex patterns that traditional models may miss, especially with limited historical data.

The Time Series Foundation Model Landscape

Many foundation models exist, each with different training approaches and capabilities:

  • TimeGPT (Nixtla)
  • TimesFM (Google)
  • Lag-Llama (Lag-Llama Team)
  • Chronos / Chronos-2 (Amazon)
  • Moirai / Moirai-2 (Salesforce)
  • Moment (CMU)
  • And many others…

Key question: Which models are suitable for econometric forecasting?

Requirements for Econometric Forecasting

For macroeconomic forecasting, we need specific capabilities:

  1. Multivariate Forecasting
    • Handle multiple related time series (GDP, inflation, unemployment, etc.)
    • Capture cross-variable dependencies
  2. Uncertainty Quantification
    • Probabilistic forecasts with prediction intervals
    • Quantile predictions for risk assessment
    • Essential for policy decision-making

Not all foundation models support both requirements!

AWS SageMaker Environment

The hackathon runs in a fully-equipped AWS SageMaker environment:

Compute Resources:

  • 💻 2 × CPU instances for development and experimentation
  • 🚀 Each CPU instance is paired with its own GPU accelerator for fast model training and inference
  • 📦 S3 bucket for data storage

Development Tools:

  • 🖥️ Terminal with bash access
  • 📓 Jupyter Lab for interactive development
  • ✏️ Python Editor with LSP support
  • 🐍 Python 3.12 with Conda and Pip pre-installed

Three-Tier Access System

We provide three tiers of access to foundation models:

Tier 1: TSFM PackageEasiest

  • High-level Python package
  • Simple interface to load models and forecast
  • Perfect for getting started quickly

Tier 2: Ready-Made Notebooks

  • Pre-configured notebook examples with pre-deployed models
  • Use as starting point for your solution
  • Details provided later in hackathon prep

Tier 3: Full Flexibility 🔓 Most Flexible

  • Complete internet access (GitHub, HuggingFace, PyPI)
  • Install any package you want
  • Access any model you want
  • Tailor the model however you want

Tier 1: TSFM Package

Why TSFM?

  • 🔄 One Interface, Multiple Models: Switch from AR to Chronos to Moirai with one line
  • 📅 Works With Any Frequency: Automatic detection of monthly, quarterly, weekly, daily
  • 🎁 Batteries Included: Metrics (RMSFE, MAE, ME), plots, prediction intervals
  • 🚀 Production Ready: Consistent API makes integration seamless

Installation

# In SageMaker environment - simple one-liner
pip install tsfmecb

That’s it! No complex setup, no dependency hell.

Your First Forecast

from tsfm import Model, generator

# Generate sample data (or use your own DataFrame)
df = generator()

# Build a model - try "armodel", "moirai", "moirai2", "chronos", or "chronos2"
mdl = Model.build(name="moirai2")

# Generate forecasts
yhs = mdl.pred(df, y="y",x=["x"], ctx_len=12, horizon=6, 
               oos_start="2005-01-31")

# View results
yhs.summary()  # See metrics
yhs.plot_actual_vs_pred(horizon=1)  # Visualize forecasts

That’s it! The model automatically:

  • Handles loading the backbone + running it efficiently to generate predictions
  • Computes accuracy metrics
  • Provides prediction intervals

Switch Models Effortlessly

The beauty of TSFM is how easy it is to compare models:

# Classical autoregressive model
mdl_ar = Model.build(name="armodel")

# Salesforce Moirai foundation model
mdl_moirai = Model.build(name="moirai2")

# Amazon Chronos foundation model
mdl_chronos = Model.build(name="chronos2")

Same interface, different models - no code rewrite needed!

Available Models

Model Type Covariates Speed
armodel Classical AR ⚡⚡⚡
moirai Foundation (Salesforce 1.1)
moirai2 Foundation (Salesforce 2.0) ⚡⚡⚡
chronos Foundation (Amazon Bolt) ⚡⚡
chronos2 Foundation (Amazon 2.0) ⚡⚡⚡

Recommendation

Start with the simple armodel to verify that your output is as expected.

What You Get

Every forecast returns a ForecastOutput object with everything you need:

Predictions

# MultiIndex DataFrame
yhs.df_preds

Metrics

# By horizon
yhs.rmsfe  # RMSFE
yhs.mae    # MAE  
yhs.me     # ME

Visualization

# Quick summary
yhs.summary()

# Plot with uncertainty bands
yhs.plot_actual_vs_pred(horizon=1)

Uncertainty

# Quantile forecasts
yhs.df_preds.xs(0.1, level='quantile')
yhs.df_preds.xs(0.9, level='quantile')

What You Get

Predictions

# MultiIndex DataFrame
yhs.df_preds

What You Get

Summary statistics

# Quick summary
yhs.summary()

What You Get

Visualisation

# Plot with uncertainty bands
yhs.plot_actual_vs_pred(horizon=6)

Tier 2 & Tier 3

Tier 2: Ready-Made Notebooks

  • Pre-configured notebooks with deployed models in SageMaker
  • Starting templates for your forecasting solution
  • Details will be covered later in hackathon prep

Tier 3: Full Flexibility 🔓

  • Complete internet access: GitHub, HuggingFace, PyPI
  • Install any package you want
  • Access any model you want
  • Maximum control for advanced users

Get Started

Resources

  • GitHub: github.com/IliasAarab/tsfm
  • Tutorial Notebook: Complete examples and data format requirements
  • Documentation: Full API reference in README
# Start now in SageMaker
pip install tsfmecb